'use strict';

/**
 * @ngdoc function
 * @name flightAdminApp.controller:MainCtrl
 * @description
 * # MainCtrl
 * Controller of the flightAdminApp
 */
define(['amazeui', 'jquery', 'global/url', 'global/constants'],
  function(amazeui, jquery, url, constants) {
    return ['$scope', '$rootScope', function($scope, $rootScope) {
	    if ($scope.accessToken) {
	   		window.location.href = constants.pages.dashboard;
	    } 

	    $scope.$watch('adminName', function(newVal, oldVal) {
	        $scope.adminName = newVal;
   		});  	
    }];
  }
)